﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TraceThisItem.WebUI.ItemTypes.Default" %>
<asp:Content ID="Head" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Body" ContentPlaceHolderID="MainContent" runat="server">
    <h1>
		Administraci&oacute;n de Tipos de Items
	</h1>
	<p>
        <asp:Button ID="btnAgregarNuevoTipoDeItem" Text="Agregar nuevo tipo de item" 
            runat="server" onclick="btnAgregarNuevoTipoDeItem_Click" Width="186px" />			
    </p>
    <asp:GridView ID="ItemTypesGridView" runat="server" 
    AutoGenerateColumns="False" DataSourceID="ItemTypesDataSource" Width="859px" 
        EmptyDataText="No hay tipos de item para el proyecto elegido" 
		onrowcommand="ItemTypesGridView_RowCommand" DataKeyNames="Id">
        <Columns>
            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />        	
            <asp:TemplateField HeaderText="Workflow" SortExpression="Workflow">				
				<ItemTemplate>
					<asp:Literal ID="WorkflowLiteral" runat="server" Text='<%# Eval("Workflow") %>'></asp:Literal>
				</ItemTemplate>
			</asp:TemplateField>
        	<asp:TemplateField HeaderText="Acciones" ShowHeader="False">
				<ItemTemplate>
				
					<asp:ImageButton ID="EditImageButton" 
						ImageUrl="~/Styles/Images/NewDocumentHS.png" CommandName="Edit" 
						runat="server" />
					<asp:ImageButton ID="DeleteImageButton" 
						ImageUrl="~/Styles/Images/DeleteHS.png" CommandName="Delete" OnClientClick="return confirm('Esta seguro que desea eliminar el tipo de item')" 
						runat="server" />
				
				</ItemTemplate>
				<EditItemTemplate>
					<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
						CommandName="Update" Text="Update"></asp:LinkButton>
					&nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
						CommandName="Cancel" Text="Cancel"></asp:LinkButton>
				</EditItemTemplate>
			</asp:TemplateField>
        </Columns>
       
    </asp:GridView>
	
    
    <asp:ObjectDataSource ID="ItemTypesDataSource" runat="server" 
        OldValuesParameterFormatString="original_{0}" 
        onobjectcreating="ItemTypesDataSource_ObjectCreating" 
        SelectMethod="GetItemTypesFromProject" 
        TypeName="TraceThisItem.Domain.Facade" 
        onselecting="ItemTypesDataSource_Selecting" 
		DataObjectTypeName="TraceThisItem.Domain.ItemType" 
		UpdateMethod="UpdateItemType" DeleteMethod="RemoveItemType">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="projectId" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
      
</asp:Content>
